﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

class Date
{
public:
	Date(int year, int month, int day)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	void Print()
	{
		cout << _year << "/" << _month << "/" << _day<<endl;
	}

	bool operator==(const Date& x)
	{
		return _year == x._year
			&& _month == x._month
			&& _day == x._day;
	}
private:
	int _year;
	int _month;
	int _day;
};
int main()
{
	Date d1(2024, 11, 15);
	Date d2(2024, 11, 30);

	bool ret1 = d1 == d2;
	cout << ret1 << endl;

	return 0;
}


//// 编译报错：“operator +”必须⾄少有⼀个类类型的形参
//class A
//{
//public:
//	void func()
//	{
//		cout << "A::func()" << endl;
//	}
//};
//typedef void(A::* PF)(); //成员函数指针类型
//int main()
//{
//	// C++规定成员函数要加&才能取到函数指针
//	PF pf = &A::func;
//	A obj;//定义ob类对象temp
//	// 对象调⽤成员函数指针时，使⽤.*运算符
//	(obj.*pf)();
//	return 0;
//}

//#include <iostream>
//using namespace std;
//

//int main()
//{
//	int i = 1, j = 3;
//	int ret1 = i + j;
//	bool ret2 = i == j;
//	int ret3 = i ^ j;
//	return 0;
//}